import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { routers as reserveRoutes } from '/@/views/reserve/router'
import { routers as borderRoutes } from '/@/views/board/router'

const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('./views/login'),
  },
  {
    path: '/organization',
    name: 'Organization',
    component: () => import('./views/organization'),
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('./views/login/register'),
  },
  {
    path: '/password',
    name: 'Password',
    component: () => import('./views/login/password'),
  },
  {
    path: '/xieyi',
    name: 'Xieyi',
    component: () => import('./views/xieyi'),
  },
  {
    path: '/evaluate-details',
    name: 'EvaluateDetails',
    component: () => import('./views/evaluate/evaluate-details.vue'),
    props: (route: any) => route.query,
  },
  {
    path: '/',
    component: () => import('./views/layout'),
    children: [
      ...reserveRoutes,
      ...borderRoutes,
      {
        path: '', // 默认子路由，只能有1个
        name: 'home',
        component: () => import('./views/home'),
      },
      {
        path: 'home', // 默认子路由，只能有1个
        name: 'Home',
        component: () => import('./views/home'),
      },
      {
        path: '/me',
        name: 'Me',
        component: () => import('./views/me'),
      },
      {
        path: '/evaluate',
        name: 'Evaluate',
        component: () => import('./views/evaluate'),
      },
      {
        path: '/evaluate-result',
        name: 'EvaluateResult',
        component: () => import('./views/evaluate/evaluate-result.vue'),
        props: (route) => route.query,
      },
      {
        path: '/evaluate-report',
        name: 'EvaluateReport',
        component: () => import('./views/evaluate/evaluate-report.vue'),
        props: (route) => route.query,
      },
      {
        path: '/classify',
        name: 'Classify',
        component: () => import('./views/classify'),
      },
      {
        path: '/details',
        name: 'Details',
        component: () => import('./views/details'),
        props: (route) => route.query,
      },
      {
        path: '/article',
        name: 'Article',
        component: () => import('./views/article'),
      },
      {
        path: '/articleDetail',
        name: 'ArticleDetail',
        component: () => import('./views/articleDetail'),
      },
      // {
      //   path: '/workspace',
      //   name: 'Workspace',
      //   component: () => import('./views/workspace'),
      // },
      {
        path: '/todoDetail',
        name: 'TodoDetail',
        component: () => import('./views/todo/todo.vue'),
      },
      {
        path: '/todo',
        name: 'Todo',
        component: () => import('./views/todo'),
      },
      {
        path: '/cloud',
        name: 'Cloud',
        component: () => import('./views/cloud/cloud.vue'),
      },
      {
        path: '/house',
        name: 'House',
        component: () => import('./views/house/house.vue'),
      },
      {
        path: '/area-serive',
        name: 'AreaSerive',
        component: () => import('./views/areaService/areaService.vue'),
      },
      {
        path: '/expert',
        name: 'expert',
        component: () => import('./views/expert/index.vue'),
      },
      {
        path: '/set-phone',
        name: 'set-phone',
        component: () =>
          import('./views/me/aboutMe/information/setPhone/phone.vue'),
      },
      {
        path: '/consultManage',
        name: 'consultManage',
        component: () => import('/@/views/consultant/manage.vue'),
      },
      {
        path: '/slogan',
        name: 'slogan',
        component: () => import('/@/views/consultant/slogan.vue'),
      },
      {
        path: '/qualifications',
        name: 'qualifications',
        component: () => import('/@/views/consultant/qualifications.vue'),
      },
      {
        path: '/consultFee',
        name: 'consultFee',
        component: () => import('/@/views/consultant/consultFee.vue'),
      },
      {
        path: '/expertCategory',
        name: 'expertCategory',
        component: () => import('/@/views/consultant/expertCategory.vue'),
      },
      {
        path: '/period',
        name: 'period',
        component: () => import('/@/views/consultant/period.vue'),
      },
    ],
  },
  {
    path: '',
    // redirect: '/home',
    redirect: '/Login',
    // hidden: true,
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/home',
    // hidden: true,
  },
  {
    path: '/help',
    name: 'help',
    component: () => import('./views/me/aboutMe/help/help.vue'),
  },
  {
    path: '/introduction',
    name: 'introduction',
    component: () => import('./views/me/aboutMe/introduction/introduction.vue'),
  },
  {
    path: '/problem',
    name: 'problem',
    component: () => import('./views/me/aboutMe/problem/index'),
  },
  {
    path: '/expert-details',
    name: 'expertDetails',
    component: () => import('./views/expert/expert.vue'),
  },
  {
    path: '/consult',
    name: 'consult',
    component: () => import('./views/me/aboutMe/consultRecord/index.vue'),
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('./views/me/aboutMe/reserveRecord/index.vue'),
  },
  {
    path: '/evaluation',
    name: 'evaluation',
    component: () => import('./views/me/aboutMe/evaluation/evaluation.vue'),
  },
  {
    path: '/bindInfo',
    name: 'bindInfo',
    component: () => import('./views/me/aboutMe/bindInfo/index.vue'),
  },
  {
    path: '/information',
    name: 'information',
    component: () => import('./views/me/aboutMe/information/information.vue'),
  },
  {
    path: '/student-evaluate',
    name: 'student-evaluate',
    component: () => import('/@/views/student-evaluate/studentEvaluate.vue'),
  },
  {
    path: '/code-evaluation',
    name: 'code-evaluation',
    component: () => import('./views/qrcode/code-evaluate.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
